package com.chuangjiangx.member.coupon.ddd.dal.mapper;

import com.chuangjiangx.member.coupon.ddd.dal.dto.*;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 卡劵库存消费情况等信息
 * @author cj-yzh
 * @date 2018/8/10 下午3:51
 *
 */

public interface MbrCouponMarketingMapper {

    //查询基本信息  卡券名称。。
    MbrCouponMarketingInfo selectCoupon(@Param(value = "id") long marchantId , @Param(value = "name") String name);

    //根据商户id和卡券名称查询基本信息
    MbrCouponMarketingInfo selectCouponByMerchantId(@Param(value = "id") long marchantId,@Param(value = "name") String name);

    //查询卡劵使用情况
    MbrUsedInfo selectCouponUsed(@Param(value = "id") long marchantId, @Param(value = "name") String name);

    //按天查询卡劵领取情况
    List<MbrReceiveByDay> receiveCouponByDay(@Param(value = "id") long marchantId, @Param(value = "name") String name);

    //查询拉新人数
    MbrActivityPullNewEffect selectNewNum(@Param(value = "id") long marchantId, @Param(value = "name") String name);
    //查询回头客人数
    MbrActivityPullNewEffect selectRepeatCustomers(@Param(value = "id") long marchantId,@Param(value = "name") String name);
    //查询挽回流失人数
    MbrActivityPullNewEffect selectSaveLoseNum(@Param(value = "id") long marchantId,@Param(value = "name") String name);

    //查询范围内天内再次消费的人数
    MbrActivityRetention selectactivityRetention(@Param("time")int time , @Param("id")long marchantId, @Param(value = "name") String name);

}